package io.renren.wechat.service.contact.dto;

import com.alibaba.fastjson.annotation.JSONField;
import io.renren.wechat.common.WechatResponse;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * https://open.work.weixin.qq.com/api/doc/90001/90143/91125
 *
 * @author dmcp@qq.com
 * @since 2021/11/29 21:50
 */
@Data
public class UserLoginInfoResponse extends WechatResponse {
    /**
     * {
     *    "errcode":0,
     *    "errmsg":"ok",
     *    "usertype": 1,
     *    "user_info":{
     *        "userid":"xxxx",
     *        "open_userid":"xxx",
     *        "name":"xxxx",
     *        "avatar":"xxxx"
     *    },
     *    "corp_info":{
     *        "corpid":"wxCorpId",
     *     },
     *    "agent":[
     *        {"agentid":0,"auth_type":1},
     *        {"agentid":1,"auth_type":1},
     *        {"agentid":2,"auth_type":1}
     *    ],
     *    "auth_info":{
     *        "department":[
     *            {
     *                "id":2,
     *                "writable":true
     *            }
     *        ]
     *    }
     * }
     *
     */
    @JSONField(name = "usertype")
    private Integer userType;

    @JSONField(name = "user_info")
    private Map<String, String> userInfo;


    @JSONField(name = "corp_info")
    private Map<String, String> corpInfo;

    @JSONField(name = "agent")
    private List<Map<String, Integer>> agent;


    @JSONField(name = "auth_info")
    private Map<String, List<Map<String, Object>>> authInfo;

}
